package com.lm.shop.product.controller;

import com.lm.shop.common.utils.R;
import com.lm.shop.product.entry.ProductInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author lsk
 * @version 1.0.0
 * @ClassName ProductController.java
 * @Description 产品控制层
 * @createTime 2022年10月19日 19:18:00
 */
@RestController
@RequestMapping("product")
public class ProductController {

    @GetMapping("/getProductById/{id}")
    public R getProductById(@PathVariable("id") Long id){
        ProductInfo info = new ProductInfo();
        info.setId(String.valueOf(id));
        info.setName("苹果");
        info.setRemark("14g");
        info.setSpu("256g");
        return R.ok().setData(info);
    }
}
